// src/main/java/com/example/config/IbatisConfig.java
package com.example.demo.demos.web;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.Reader;


@Configuration
public class IbatisConfig {

    @Bean
    public SqlMapClient sqlMapClient() throws Exception {
        Reader reader = Resources.getResourceAsReader("sqlMapConfig.xml");
        return SqlMapClientBuilder.buildSqlMapClient(reader);
    }
}